<%-- 
    Document   : LoginView
    Created on : 20-jun-2013, 12:05:00
    Author     : John Castillo Valencia
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c"      uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt"    uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>.::LICI::.</title>
        <link rel="stylesheet" href="resources/dhtmlmodal/windowfiles/dhtmlwindow.css" type="text/css" />
        <script type="text/javascript" src="resources/dhtmlmodal/windowfiles/dhtmlwindow.js">
            /***********************************************
             * DHTML Window Widget- © Dynamic Drive (www.dynamicdrive.com)
             * This notice must stay intact for legal use.
             * Visit http://www.dynamicdrive.com/ for full source code
             ***********************************************/
        </script>
        <link rel="stylesheet" href="resources/dhtmlmodal/modalfiles/modal.css" type="text/css" />
        <script type="text/javascript" src="resources/dhtmlmodal/modalfiles/modal.js"></script>
        <link rel="stylesheet" type="text/css" href="css/v3.css" media="screen" />
        <script type="text/javascript" src="js/jquery-1.2.2.pack.js"></script>
        <script type="text/javascript" src="js/animatedcollapse.js"></script>
        <script type="text/javascript">
            animatedcollapse.addDiv('errormesage', 'fade=1');
            animatedcollapse.init();

            function setLogin(form) {
                form.accion.value = "Conectando..."
                form.accion.disabled = true;
                setTimeout(sendForm, 3000);
                form.accion.disabled = false;
                return false;
            }
            function sendForm() {
                var form = document.Login;
                if (form.j_username.value.length == '' || form.j_password.value.length == '') {
                    showMessageError();
                    form.j_username.focus();
                    form.accion.value = 'Intenta nuevamente';
                    form.accion.disabled = false;
                } else {
                    form.submit();
                }
            }
            function showMessageError() {
                animatedcollapse.show('errormesage');
                setTimeout('animatedcollapse.hide(\'errormesage\')',5000);
            }

                    
        </script>
    </head>
    <body bgcolor="#FFFFFF" onload="document.Login.j_username.focus()">
        <div id="header"></div>
        <div id="loginpanel">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td style="color:#666666;height:70px;width:450px;padding-left:20px" valign="bottom" class="heymaname">
                        <img alt="" src="resources/jv0h.jpg" width="80%"/><span style="font-size:6pt">TM</span><br/>
                        <span><b>LiCI</b> Gestión y Seguimiento de Licitaciones <% out.print(new java.util.Date().getYear() + 1900);%></span>                    
                        <img alt="" src="resources/Titulo3.png" width="93%"/>
<!--                        <span style="font-size:10pt"><b>USER LOG IN</b></span>-->
                    </td>
                    <td rowspan="2" style="height:150px;width:280px;background:#FFFFFF url(resources/java-oracle.jpg) no-repeat">&nbsp;</td>
                </tr>

                <tr>                  
                    <td style="height:130px; width:450px;padding-left:20px">
                        <form name="Login" action="j_spring_security_check" onsubmit="return setLogin(this)" method="post">
                            <table border="0" cellpadding="2">
                                <tr>
                                    <td><label for="j_username" class="labelTxt">Nombre de usuario: </label></td>
                                    <td><input class="text-field" type="text" name="j_username"></td>
                                </tr>
                                <tr>
                                    <td><label for="j_password" class="labelTxt">Contrase&ntilde;a: </label></td>
                                    <td><input class="text-field" type="password" name="j_password"></td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="center"><input class="button" type="submit" value="Inicio de sesi&oacute;n" name="accion"></td>
                                </tr>
                            </table>
                        </form>
                    </td>
                    <!-- espacio para el rowspan anterior -->
                </tr>
                <tr>
                    <td style="padding:10px;padding-left:20px;height:50px;width:450px" valign="top" align="left">
                        <div id="errormesage" style="position:absolute;width:200px; border:1px solid #FFCC00; padding:5px; background-color:#FFFFAE; display:none">
                            <table cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td><img alt="" src="resources/alert.gif" border="0"></td>
                                    <td><span style="color: #000000; font-size: 10pt; font-weight: bold">&nbsp;Fallo de autentificaci&oacute;n.</span></td>
                                </tr>
                            </table>
                        </div>
                    </td>
                    <td style="height:130px;padding-left:25px;padding-bottom:10px;background-color:rgb(233, 233, 233)" valign="bottom">
                        <b>LiCI</b> -  Cliente Web<br>
                        <small>Interf&aacute;z a la aplicaci&oacute;n protocolo HTTP.</small><br><br>
                        Accedido el:<br>
                        <%
                            java.util.Date now = new java.util.Date();
                            java.text.SimpleDateFormat fd = new java.text.SimpleDateFormat("EEEE, dd 'de' MMMM 'de' yyyy', hrs: ' HH:mm:ss");
                            out.println(fd.format(now));
                        %>                        
                    </td>
                </tr>
            </table>

        </div>
        <div id="logoview" style="position: absolute;right: -250px;top:70px">
            
        </div>

        <div id="footermain">
            <table style="width:800px" align="center">
                <tr>
                    <td style="padding-top:5px;">
                        <p align="justify">
                            <span style="color: #666666; font-size: 8pt;">Copyright © 2012 - App writer</span>
                        </p>
                    </td>
                </tr>
            </table>
        </div>


        <c:if test="${!empty key && key == 'failure'}">
            <script type="text/javascript">
                document.getElementById('errormesage').style.display = 'inline';
                setTimeout('animatedcollapse.hide(\'errormesage\')',5000);
            </script>
        </c:if>

        <div id="fcpnlocation" style="display:none"></div>
    </body>

</html>
